In Beta - New Dynamic Array Library

Posted By: AndrewAMD

In Beta - New Dynamic Array Library - 05/07/18 17:34

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.
Posted By: MatPed

Re: In Beta - New Dynamic Array Library - 05/07/18 20:23

Thank you, nice share.
Posted By: AndrewAMD

Re: In Beta - New Dynamic Array Library - 05/08/18 01:27

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.

Attached File
DynamicArray_beta20180507c.zip  (103 downloads)
Posted By: AndrewAMD

REVISED - Dynamic Array Library - 05/15/18 03:22

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

Attached File
DynamicArray_beta20180514.zip  (116 downloads)
Posted By: Smon

Re: REVISED - Dynamic Array Library - 05/27/18 09:25

Looks awesome, thanks for sharing!
Posted By: AndrewAMD

RELEASED - Dynamic Array Library - 06/23/18 15:18

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

Attached File
Posted By: AndrewAMD

Re: RELEASED - Dynamic Array Library - 07/05/18 14:12

The software is now in the downloads section under Zorro Tools:
http://zorro-project.com/download.php
© 2024 lite-C Forums