Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by Emre
Today at 01:03
New Zorro version 1.83
by claudio
Yesterday at 17:22
Ahead bias when retrain
by jcl
Yesterday at 12:27
Huge array for Deep Learning
by jcl
Yesterday at 12:06
[LBGUI] Memory not released!
by EVO
05/23/18 22:39
http_post undeclared identifier
by Superku
05/23/18 22:10
Pan/Tilt in relation to entity?
by Superku
05/23/18 20:59
AUM Magazine
Latest Screens
Lake scene
Forgotten Tales - Demo version
RPG PARTY
Triton Wing now available on Steam
Who's Online
9 registered (Slin, Quad, Superku, AndrewAMD, 3run, jyd, mk_1, 2 invisible), 464 Guests and 3 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
Rayharry, AgentShark, rpauletto, tuuPaul, LaserJock2000
17960 Registered Users
Topic Options
Rate This Topic
#472602 - 05/07/18 19:34 In Beta - New Dynamic Array Library
AndrewAMD Online
Member

Registered: 02/21/17
Posts: 275
Loc: Chicago
Hi guys,

I wrote a basic dynamic array library for use with Lite-C.

The purpose of this library is to provide a higher-level approach to memory allocation. The overhead should be non-existent (as long as the library is used correctly).

Included is an example script. In it, we create an arbitrary struct, fill it with values, and we push back. This behavior is much like a C++ std::vector; in fact, a C++ std::vector is used in the backend.

I'm sure you will have questions and/or feature requests. Please let me know in this thread.

Source code is here:
https://github.com/AndrewAMD/DynamicArray

The current build is attached.

I do apologize for the lack of documentation - right now, it is all in the include/dynamic.h header. Formal documentation to follow.

Thanks,
Andrew

EDIT: File removed. Scroll down for the latest build.


Edited by AndrewAMD (05/08/18 03:28)
Edit Reason: new build

Top
#472605 - 05/07/18 22:23 Re: In Beta - New Dynamic Array Library [Re: AndrewAMD]
MatPed Offline
Senior Member

Registered: 02/28/15
Posts: 431
Loc: Milano, Italy
Thank you, nice share.

Top
#472608 - 05/08/18 03:27 Re: In Beta - New Dynamic Array Library [Re: MatPed]
AndrewAMD Online
Member

Registered: 02/21/17
Posts: 275
Loc: Chicago
New function, new build!

Added darr_destroy_all(). It clears all of the dynamic arrays from memory (in the DLL).

I recommend running this function either at the beginning of main or at the beginning of INITRUN. I believe Zorro does not clean this stack between runs of the script.


Attachments
DynamicArray_beta20180507c.zip (23 downloads)


Top
#472698 - 05/15/18 05:22 REVISED - Dynamic Array Library [Re: AndrewAMD]
AndrewAMD Online
Member

Registered: 02/21/17
Posts: 275
Loc: Chicago
Major revision, new build!

Known changes:
* Added insert functionality.
* Can add multiple elements at a time.
* "destroy" was renamed to "delete" for consistency of syntax purposes. (That is, OOP regulars know what "new" and "delete" implies.)
* darr_ renamed to da_ to make functions less annoying to type.
* The example is far clearer in its demonstration of functionality, and well-commented.
* The Zorro header is the same file as the DLL header.

Other than fixing the documentation, I hope that this will be my last build before we go to first release.

I appreciate any feedback. If I receive no complaints in the next week, I will recommend it for redistribution with Zorro.

Cheers,
Andrew


Attachments
DynamicArray_beta20180514.zip (12 downloads)


Top



Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de