Skip to content

Bitmap tal support#60

Open
ghost wants to merge 5 commits into
masterfrom
unknown repository
Open

Bitmap tal support#60
ghost wants to merge 5 commits into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Aug 21, 2017

Copy link
Copy Markdown

My 1st ccan patch - be gentle.

@rustyrussell

Copy link
Copy Markdown
Owner

Hi! Thanks, this is great... @dgibson

The main problem is we don't want ccan/bitmap to depend on tal; it's a big thing to pull in. But that just means we should have a bitmap/tal module.

Two other nitpicks:

  1. We should also keep nomenclature in spec: tal uses 'z' for zero-fill, and bitmap uses 'zero' and 'fill' for 0 and 1 resp.
  2. The "return the new allocation" is an antipattern, it's better to make bitmap_tal_resize() take the pointer to the pointer. In fact, tal_resize() does not zero the pointer on failure, so your code is actually incorrect here.

I've pushed a proposal on top of your branch, see what you think?

@ghost

ghost commented Aug 23, 2017

Copy link
Copy Markdown
Author

That looks great, I think you should be a co-author :-) 👍

Follow-up questions:

  1. Naming - Well, so what do to when the conventional naming differs between the two?

  2. Let's say (purely hypothetically!) that I have a new module in mind that uses bitmaps all over,
    including creating them dynamically. Is it ok to depend on tal then? I really hate using malloc, I think something like tal should be in libc. In fact glibc has obstacks which are poor cousins.

@rustyrussell

rustyrussell commented Aug 24, 2017 via email

Copy link
Copy Markdown
Owner

@ghost

ghost commented Aug 26, 2017

Copy link
Copy Markdown
Author

Why does the build fail?

@dgibson

dgibson commented Aug 30, 2017 via email

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants