Gamestudio Links
Zorro Links
Newest Posts
How is this possible ? winning percentage 100%
by MatPed
50 minutes 13 seconds ago
Next contest?
by Michael_Schwarz
Today at 10:33
Help! 1.88.6 Crashes <5 minutes after clicking Trade!
by jcl
Today at 10:28
WFO
by jcl
Today at 10:27
TA-Lib not updated
by jcl
Today at 10:24
CyberCycle Adaptive Cy
by OptimusPrime
Today at 05:26
video memory and d3d_texfree
by Superku
Yesterday at 11:17
AUM Magazine
Latest Screens
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Who's Online
16 registered (CocaCola, kvm, MatPed, Iglarion, AndrewAMD, brax, Michael_Schwarz, Mio, 2 invisible), 454 Guests and 3 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
fandi, Deedee, avgtrader, aventador, gokhanuck
18103 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: 447
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: 495
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: 447
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 (36 downloads)


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

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


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

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

Top
#473243 - 06/23/18 17:18 RELEASED - Dynamic Array Library [Re: sdh309795gaas]
AndrewAMD Online
Senior Member

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


Top
#473431 - 07/05/18 16:12 Re: RELEASED - Dynamic Array Library [Re: AndrewAMD]
AndrewAMD Online
Senior Member

Registered: 02/21/17
Posts: 447
Loc: Chicago
The software is now in the downloads section under Zorro Tools:
http://zorro-project.com/download.php

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