Gamestudio Links
Zorro Links
Newest Posts
Get BMAP's filename...?
by Firoball
6 minutes 38 seconds ago
bone ang/pos
by 3run
Today at 15:41
Takeprofit and Stoploss
by sdelatorre
Today at 10:54
Save as .wmb
by Emre
Today at 05:57
Connors RSI implementation
by MatPed
Today at 00:37
multiple results graph in multi-asset scripts?
by SBGuy
Yesterday at 21:19
Verbose messages
by Sphin
Yesterday at 20:24
AUM Magazine
Latest Screens
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Forgotten Tales - Demo version
RPG PARTY
Who's Online
13 registered (ChrstphFr, JRA, mig, AndrewAMD, MatPed, 3run, jyd, krial057, alibaba, 1 invisible), 477 Guests and 4 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
bbn1982, selma, mbullied, Raisinbran, Grodt
17984 Registered Users
Topic Options
Rate This Topic
#472602 - 05/07/18 19:34 In Beta - New Dynamic Array Library
AndrewAMD Online
Senior Member

Registered: 02/21/17
Posts: 313
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 Online
Senior Member

Registered: 02/28/15
Posts: 442
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
Senior Member

Registered: 02/21/17
Posts: 313
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
Senior Member

Registered: 02/21/17
Posts: 313
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 (16 downloads)


Top
#472873 - 05/27/18 11:25 Re: REVISED - Dynamic Array Library [Re: AndrewAMD]
sdh309795gaas Offline
Junior Member

Registered: 12/07/14
Posts: 95
Looks awesome, thanks for sharing!

Top
#473243 - 51 minutes 45 seconds ago RELEASED - Dynamic Array Library [Re: sdh309795gaas]
AndrewAMD Online
Senior Member

Registered: 02/21/17
Posts: 313
Loc: Chicago
I guess no news is good news?

RELEASED FOR PRODUCTION!

Attached is the latest build.

Regarding documentation:
* Overview and build instructions: https://github.com/AndrewAMD/DynamicArray
* Function descriptions are in the header.
* The example script should have more than enough info to get you started.

Thanks,
Andrew


Attachments
DynamicArray_release_20180623.zip (0 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