Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Please help with porting of little lib.
« previous next »
  • Print
Pages: [1]

Author Topic: Please help with porting of little lib.  (Read 4113 times)

Offline Gnelik

  • Member
  • *
  • Posts: 3
Please help with porting of little lib.
« on: December 03, 2006, 01:44:28 PM »
It is lib for parsing math expressions.
The most problem is in memory managment.
please help!!!



[attachment deleted by admin, too old]
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Please help with porting of little lib.
« Reply #1 on: December 03, 2006, 02:55:05 PM »
If the calls to malloc are the only problem, it looks like you could just statically allocate memory for them.  Theres only two, and it looks like they're fairly small variables anyway (I think?).
Logged

Offline Gnelik

  • Member
  • *
  • Posts: 3
Re: Please help with porting of little lib.
« Reply #2 on: December 04, 2006, 11:01:16 AM »
I can't understand how to make it work with array :(.
I am going to write a graph builder but i can't continue without it. Please help me!
« Last Edit: December 04, 2006, 11:16:36 AM by Gnelik »
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Please help with porting of little lib.
« Reply #3 on: December 05, 2006, 06:41:05 PM »
Well since the variable you're mallocing space for is tydefed like so:

typedef struct ff_expr_s AVEvalExpr;

I'm not too surprised arrays don't work ;)
Logged

Offline Bagder

  • Member
  • *
  • Posts: 1452
    • Daniel's site
Re: Please help with porting of little lib.
« Reply #4 on: December 06, 2006, 03:50:37 AM »
Since the malloc()s are used to build trees etc in this code, I would advice having two arrays of structs, and then for each malloc() you pick one from the list to use and mark it as used - simulating malloc(). The number of array entries would need to be tweaked to work with a suitable worst case.
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Please help with porting of little lib.
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.31 seconds with 15 queries.