-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR: from frugalos_dyn to master #1
base: master
Are you sure you want to change the base?
Conversation
src/galois.c
Outdated
if (!gfp) { | ||
gf2p = (gf2_t *) malloc(sizeof(gf2_t)); | ||
gf2p->gf = (gf_t *) malloc(sizeof(gf_t)); | ||
if (!gf2p || gf2p->gf) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this line be like if (!gf2p || !gf2p->gf)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
se-ya-na
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to fix this.
{ | ||
int *matrix, i; | ||
|
||
if (m == 2 && k <= cbest_max_k[w]) { | ||
matrix = talloc(int, k*m); | ||
if (matrix == NULL) return NULL; | ||
if (!cbest_init) { | ||
if (!cbest_init) { /* not safe for multithreads. need CAS */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これは未修正?
extern int galois_uninit_field(int w); | ||
extern void galois_change_technique(gf_t *gf, int w); | ||
typedef struct gf2_t_ { | ||
gf_t* gf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get why this member is necessary.
I think it's okay to remove this member and make galois_init_field
return both gf2_t
and gf_t
created.
I'm commenting because it seems that gf2_t
is the global state packed in a struct, and gf_t* gf
created in galois_init_field
doesn't look like a global state and is not used elsewhere in this repository.
(except initialization and galois_destroy
, of course!)
gf_t* gf; | ||
gf_t* gfp_array[64]; | ||
int gfp_is_composite[64]; | ||
} gf2_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't recommend naming this struct as gf2_t
because it is easily confused with GF(2)
, the finite field with two elements. (gf_state_t
should be better I think?)
Should refer to frugalos/liberasurecode#4 |
frugalos_dynブランチは以下の内容を含む:
(libFrugalosJerasureへの変更などは、openstack/liberasurecodeの変更などを生む)